//
//  MainInfoCell.m
//  PotentialTraining
//
//  Created by admin on 2018/1/29.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "MainInfoCell.h"

@implementation MainInfoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.headerImg.clipsToBounds = YES;
    self.headerImg.layer.cornerRadius = 50;
    self.headerImg.layer.borderWidth = 2;
    self.headerImg.layer.borderColor = kColor(200, 200, 200).CGColor;
}

- (void) configWithData:(NSDictionary *)dic{
    NSString *name = dic[@"nickname"];
    if (name.length > 0 ) {
        self.nameLabel.text = name;
    }else {
      self.nameLabel.text = dic[@"username"] ?: @"";
    }
    self.contentLabel.text = dic[@"sign"] ?: @"";
    [self.headerImg sd_setImageWithURL:dic[@"icon_path"] placeholderImage:[UIImage imageNamed:@"touxiang"]];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
